#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/wait.h>

main()
{
    struct rlimit rl;
    int i,pid;

    i = getrlimit(RLIMIT_DATA,&rl);

    printf("%d: data size %d\n",getpid(),rl.rlim_max);

    rl.rlim_cur = 5000;
    rl.rlim_max = 5000;

    i = setrlimit(RLIMIT_DATA,&rl);

    printf("i=%d\n",i);
    while (1)
    {
        i = malloc(2000);
        printf("i=%d\n",i);
    }
}
